package cn.lg.soar.system.feign;


import cn.lg.soar.core.annotations.ApiClient;
import cn.lg.soar.system.api.constant.ModuleConst;
import cn.lg.soar.system.api.model.TenantDTO;
import cn.lg.soar.system.api.service.ITenantApi;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author luguoxiang
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
@ConditionalOnProperty(name = "lg.database.enabled-tenant", havingValue = "true")
@ConditionalOnMissingClass("cn.lg.soar.system.auth.client.TenantApiClient")
@ApiClient
@FeignClient(
        name= ModuleConst.MODULE_NAME,
        path= ModuleConst.CLIENT_PATH + "/user",
        contextId="TenantApiFeign"
)
public interface TenantApiFeign extends ITenantApi {

    @GetMapping("listByIds")
    @Override
    List<TenantDTO> listByIds(@RequestParam("ids") List<Integer> ids);

    @GetMapping("getById")
    @Override
    TenantDTO getById(@RequestParam("id") Integer id);

}
